package com.jin.spirng_boot_learn.services.impl;

import com.jin.spirng_boot_learn.BO.StudentBO;
import com.jin.spirng_boot_learn.domain.Student;
import com.jin.spirng_boot_learn.helper.StudentHelper;
import com.jin.spirng_boot_learn.repository.StudentDataRestRepository;
import com.jin.spirng_boot_learn.services.StudetnsSerivce;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("StudetnsSerivce")
public class StudentsServiceImp implements StudetnsSerivce {


    @Resource
    private StudentDataRestRepository studentDataRestRepository;


    @Override
    public StudentBO create(StudentBO studentBO) {
        Student student = studentDataRestRepository.save(StudentHelper.convertStudent(studentBO));
        return StudentHelper.convertStudentBO(student);
    }

    @Override
    public StudentBO update(StudentBO studentBO) {
        return null;
    }

    @Override
    public StudentBO delete(StudentBO studentBO) {
        return null;
    }

    @Override
    public StudentBO findById(StudentBO studentBO) {
        return null;
    }
}
